/*
 * Powered By [rapid-framework]
 * Csdn Code: generate simple CRUD code in single table.
 * Since 2015 - 2017
 */

package com.vcredit.creditcat.service.income;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.vcredit.creditcat.model.IncomeLog;
import com.vcredit.creditcat.model.IncomeLogExt;
import com.vcredit.creditcat.model.ext.IncomeForPcExt;
import com.vcredit.creditcat.persistence.IncomeLogExtMapper;
import com.vcredit.creditcat.persistence.base.IncomeLogMapper;

/*
 * @author zhangxingong
 * @version 1.0
 * @since 1.0
*/
@Service
public class IncomeLogService {

  @Autowired
  private IncomeLogMapper incomeLogMapper;

  @Autowired
  private IncomeLogExtMapper incomeLogExtMapper;

  public List<IncomeLogExt> findMyIncome(Long custId){
	  return incomeLogExtMapper.findMyIncome(custId);
  }

  public List<IncomeLog> find(IncomeLog incomeLog) {
    return incomeLogMapper.find(incomeLog);
  }

  public IncomeLog findById(Long id) {
    return incomeLogMapper.findById(id);
  }

  public List<IncomeLog> findAll() {
    return incomeLogMapper.findAll();
  }

  public void insert(IncomeLog incomeLog) {
    incomeLogMapper.insert(incomeLog);
  }

  public void update(IncomeLog incomeLog) {
    incomeLogMapper.update(incomeLog);
  }

	public List<IncomeForPcExt> pageQueryForPc(Map<String,Object> param) {
		return incomeLogExtMapper.pageQueryForPc(param);
	}

	public long queryCountForPc(Map<String, Object> param) {
		return incomeLogExtMapper.queryCountForPc(param);
	}
	
	  public BigDecimal getAccumulatedIncome(Long custId){
		  return incomeLogExtMapper.getAccumulatedIncome(custId);
	  }

}
